<%-- 
    Document   : inscription
    Created on : 13 janv. 2015, 18:17:52
    Author     : Killian
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %> 
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title><s:text name="inscription.title"/></title>
        <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
        <link href="css/styles.css" rel="stylesheet" type="text/css">
    </head>
    <body>
        <header>
            <nav class="navbar navbar-default">
                <div class="container-fluid">
                    <!-- Brand and toggle get grouped for better mobile display -->
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                            <span class="sr-only"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a class="navbar-brand" href="accueil"><s:text name="accueil.titleNavBar"/></a>
                    </div>

                    <!-- Collect the nav links, forms, and other content for toggling -->
                    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                        <ul class="nav navbar-nav">
                            <li class="dropdown">
                                <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-expanded="false">
                                    <s:text name='menu.adresses'/> <span class="caret"></span>
                                </a>
                                <ul class="dropdown-menu" role="menu">
                                    <li><a href="listAddress"><s:text name="menu.listeAdresses"/></a></li>
                                    <li><a href="<s:url action="ajout_ip"/>"><s:text name='menu.ajoutAdresse'/></a></li>
                                </ul>
                            </li>
                            <s:if test="%{#session.droit == 'admin'}">
                                <li class="dropdown">
                                    <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-expanded="false">
                                        <s:text name='menu.utilisateurs'/> <span class="caret"></span>
                                    </a>
                                    <ul class="dropdown-menu" role="menu">
                                        <li><a href="listUsers"><s:text name="menu.listeUtilisateurs"/></a></li>
                                        <li class="active"><a href="#"><s:text name='menu.ajoutUser'/></a></li>
                                    </ul>
                                </li> 
                            </s:if>
                            <li><a href="apropos"><s:text name="menu.aPropos"/></a></li>
                        </ul>                  
                        <ul class="nav navbar-nav navbar-right">
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><s:text name="accueil.profil"/><strong><s:property value="%{#session.user.identifiant}"/></strong><span class="caret"></span></a>
                                <ul class="dropdown-menu" role="menu">
                                    <li>
                                        <s:url id="profil" action="profil">
                                            <s:param name="id_user" value="%{#session.user.id_user}"></s:param>                
                                        </s:url>
                                        <s:a href="%{profil}"><s:text name="accueil.myprofil"/></s:a>
                                        </li>
                                        <li>
                                        <s:url id="editProfil" action="editProfil">
                                            <s:param name="id_user" value="%{#session.user.id_user}"></s:param>                
                                        </s:url>
                                        <s:a href="%{editProfil}"><s:text name="accueil.modifierProfil"/></s:a>
                                        </li>   
                                        <li class="divider"></li>
                                        <li><a href="logout"><s:text name="accueil.deconnexion"/></a></li>
                                </ul>
                            </li>
                        </ul>

                    </div><!-- /.navbar-collapse -->

                </div><!-- /.container-fluid -->
            </nav>
        </header>
        <div id="divInscription" class="page-header">
            <form name="inscription_form" action="addUser" method="post" class="form-horizontal inscription_form">
                <fieldset>

                    <!-- Form Name -->
                    <legend style="padding : 10px;"><s:text name="inscription.titreForm"/></legend><span class="required_notification">* Champs obligatoires</span>
                        <s:hidden name="id_user" />
                    <div>
                        <!-- Text input-->
                        
                        <div class="form-group">
                            
                            <label class="col-md-4 control-label" for="identifiant"><s:text name="inscription.identifiant"/></label>  
                            <div class="col-md-4">                            
                                <div><input id="identifiant" name="identifiant" placeholder="" value="${identifiant}" class="form-control input-md" required="" type="text" pattern="[a-zA-Z\d\s]{3,50}">                                  
                                    <div class="input-validation"></div>
                                </div>
                                <s:fielderror fieldName="identifiant" cssStyle="color:red;" />
                                <span class="help-block"><s:text name="inscription.consigneIdentifiant"/></span>  
                            </div>
                        </div>

                        <!-- Text input-->
                        <div class="form-group">
                            <label class="col-md-4 control-label" for="mail">Adresse mail</label>  
                            <div class="col-md-4">
                                <input id="mail" name="mail" placeholder="dupont@host.com" value="${mail}" class="form-control input-md" required="" type="email">
                                <s:fielderror fieldName="mail" cssStyle="color:red;" />
                                <span class="help-block">Respecter le format</span>  
                            </div>
                        </div>

                        <!-- Droits -->
                        <div class="form-group">
                            <div class="col-sm-offset-4 col-sm-10">
                                <div class="radio">
                                    <label>
                                        <input type="radio" name="id_droit" id="droit1" value="1" checked>
                                        <s:text name="inscription.droitAdmin"/>
                                    </label>
                                </div>
                                <div class="radio">
                                    <label>
                                        <input type="radio" name="id_droit" id="droit2" value="2">
                                        <s:text name="inscription.droitNormal"/>
                                    </label>
                                </div>
                            </div>
                        </div>

                        <!-- Password input-->
                        <div class="form-group">
                            <label class="col-md-4 control-label" for="password">Mot de passe</label>
                            <div class="col-md-4">
                                <input id="password" name="password" placeholder="Saisissez un mot de passe robuste" class="form-control input-md" required="" type="password" pattern="[a-zA-Z\d\s]{5,50}">
                                <s:fielderror fieldName="password" cssStyle="color:red;" />
                                <span class="help-block">Doit faire plus de 5 caractères</span>
                            </div>
                        </div>

                        <!-- Password input-->
                        <div class="form-group">
                            <label class="col-md-4 control-label" for="passwordConfirm">Confirmation mot de passe</label>
                            <div class="col-md-4">
                                <input id="passwordConfirm" name="passwordConfirm" placeholder="" class="form-control input-md" required="" type="password" pattern="[a-zA-Z\d\s]{5,50}">
                                <s:fielderror fieldName="passwordConfirm" cssStyle="color:red;" />
                            </div>
                        </div>                      

                        <!-- Button (Double) -->
                        <div class="form-group">
                            <label class="col-md-4 control-label" for="save"></label>
                            <div class="col-md-8">
                                <button type="submit" class="btn btn-primary">Enregistrer</button>
                                <a id="cancel" class="btn btn-default" href="javascript:window.history.back();"><s:text name='general.retour'/></a>
                            </div>
                        </div>


                    </div>
                </fieldset>
            </form>
        </div>

        <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
    </body>
</html>
